package com.itjeffrey.autocode.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itjeffrey.autocode.bo.RoleInfoTbBO;
import com.itjeffrey.autocode.bo.UserInfoBO;
import com.itjeffrey.autocode.bo.req.IsEnableBO;
import com.itjeffrey.autocode.bo.req.RelateRoleBO;
import com.itjeffrey.autocode.common.Result;
import com.itjeffrey.autocode.entity.UserInfoEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;

/**
 * @From: Jeffrey
 * @Date: 2020/12/8
 */
public interface UserService extends IService<UserInfoEntity> {

    Result uploadAvater(MultipartFile multipartFile);

    Result getAvaUrl();

    Set<String> findPermission(String username, String resType);

    String getUserNameByLoginName(String loginName);

    List<RoleInfoTbBO> queryRoleInfosByUsername(String username);

    /**
     * username是否有resType类型的resName资源权限
     * @param username 用户名
     * @param resName 资源名
     * @param resType 资源类型
     * @return
     */
    boolean hasResource(String username, String resName, String resType);

    Result queryList(UserInfoBO userInfoBO);

    Result isEnable(IsEnableBO isEnableBO);

    Result queryOne(String loginname);

    Result modUser(UserInfoBO userInfoBO);

    Result delete(String loginname);

    Result relateRole(RelateRoleBO relateRoleBO);

    Result queryRoleInfosByLoginName(String loginName);
}
